<%@page import="Model.Purchase.PurchaseList"%>
<%@page import="RssEasy.Core.CookieHelper"%>
<%@page import="Model.My.PurchaseResultListView"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
    PurchaseResultListView pur = new PurchaseResultListView(pageContext);
    PurchaseList pu = new PurchaseList(pageContext);
    CookieHelper  cookie = new CookieHelper(request, response);
    pur.request();
    int pag = Integer.parseInt(pur.get("page"));
    String stor = pur.get("stor");
    String shijian = pur.get("shijian");
    String enddt = pur.get("enddt");
    String myid ="";
    String level = cookie.Get("level");
    if(level.equals("0")){
     myid =cookie.Get("myid");
    }else{
     myid=cookie.Get("level");
    }
    pag = (pag-1)*10;
    if(shijian.equals("")){
      shijian="-1";
    }
    if(enddt.equals("")){
        enddt="9999999999";
    }
    if(stor.equals("1")){
    pur.query("SELECT id,name,shijian,enddt from purchase_result_view WHERE purchase_class="+pur.get("purchase_class")+" and typid=2 and myid="+myid+" and shijian >= "+shijian+" and shijian <= "+enddt+" order by id desc LIMIT "+pag+",10");
    out.print(pur.toKeyValue());
    }
    if(stor.equals("2")){
    pu.query("SELECT id,name,shijian,enddt from purchase_list WHERE purchase_class="+pur.get("purchase_class")+" and typid=2 and myid="+myid+" and shijian >= "+shijian+" and shijian <= "+enddt+" order by id desc LIMIT "+pag+",10");
    out.print(pu.toKeyValue());
    }
%>
